package com.scfire.project

import org.grails.databinding.BindingFormat

import com.scfire.project.Project
/** 
* @ClassName: ProjectClosing 
* @Description: TODO(结项报告) 
* @author 张健
* @date 2016年5月13日 上午10:33:45 
*  
*/
class ProjectClosing implements Comparable{
	
	//项目名称（适当冗余）
	String projectName
	
	//项目真实花费
	float realSpend;
	
	//发票总额
	float tltalInvoice;
	
	//发票图片
	List<String> invoiceImgs = new LinkedList<String>();
	
	//筹款明细
	String fundraisingDetail
	
	//收益人群
	String profitPeople;
	
	//收益人数
	int profitNum;
	
	//结项概述
	String summary;
	
	//概述图片
	List<String> summaryImgs = new LinkedList<String>();
	
	//创建时间
	@BindingFormat('yyyy-MM-dd HH:mm:ss')
	Date createDate
	
	//更新日期
	@BindingFormat('yyyy-MM-dd HH:mm:ss')
	Date updateDate	
	//备注
	String remarks
	
	//orm框架保存问题，以后所有外键均手动维护
	int project
	
	//创建者id
	int member
	
	//结项状态
	String verified
	static constraints = {
		projectName nullable:true
		realSpend nullable:true
		tltalInvoice nullable:true
		invoiceImgs nullable:true
		fundraisingDetail nullable:true
		profitPeople nullable:true
		profitNum nullable:true
		summary nullable:true
		summaryImgs nullable:true
		createDate nullable:true
		updateDate nullable:true
		remarks nullable:true
		projectid:nullable:true
		memberid:nullable:true
		verified:nullable:true
	}
	@Override
	public int compareTo(Object o) {
		try{
			createDate.compareTo(o?.createDate)
		}catch(Exception e){
			return 1
		}
	}
	
	
	

}
